]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
Use a fixed width for visible portion of workspace thumbnails
authorOwen W. Taylor <otaylor@fishsoup.net>
Thu, 10 Feb 2011 00:07:27 +0000 (19:07 -0500)
committerOwen W. Taylor <otaylor@fishsoup.net>
Thu, 17 Feb 2011 16:34:30 +0000 (11:34 -0500)
We will change the workspace thumbnail size as we get more thumbnails; it doesn't
really make sense to always show 1/5 of the thumbnails how big or small they are,
so instead show a CSS-configurable length.

https://bugzilla.gnome.org/show_bug.cgi?id=641879

data/theme/gnome-shell.css
js/ui/workspacesView.js

index b144d18e2ab176824a97a6801db9ccd95356c130..dbbf95df4ed9c66d9e41c27edbfbc3ee37e63cf5 100644 (file)
@@ -268,6 +268,7 @@ StTooltip StLabel {
     border-right: 0px;
     border-radius: 9px 0px 0px 9px;
     background: #071524;
+    visible-width: 32px; /* Amount visible before hovering */
 }
 
 .workspace-thumbnails {
index 691ef67a409abb7aa16b6da2872ae7eebc8741f9..930383e51ba5dada89131dadafa70a20042e3a2e 100644 (file)
@@ -22,7 +22,6 @@ const WORKSPACE_SWITCH_TIME = 0.25;
 const MAX_WORKSPACES = 16;
 
 
-const CONTROLS_POP_IN_FRACTION = 0.8;
 const CONTROLS_POP_IN_TIME = 0.1;
 
 
@@ -640,9 +639,9 @@ WorkspacesDisplay.prototype = {
         let totalHeight = totalAllocation.y2 - totalAllocation.y1;
 
         let [controlsMin, controlsNatural] = this._controls.get_preferred_width(totalHeight);
-        let controlsReserved = controlsNatural * (1 - CONTROLS_POP_IN_FRACTION);
+        let controlsVisible = this._controls.get_theme_node().get_length('visible-width');
 
-        totalWidth -= controlsReserved;
+        totalWidth -= controlsVisible;
 
         // Workspaces expect to have the same ratio as the screen, so take
         // this into account when fitting the workspace into the available space
@@ -663,9 +662,9 @@ WorkspacesDisplay.prototype = {
         y = Math.floor(y + Math.abs(totalHeight - height) / 2);
 
         if (rtl)
-            x += controlsReserved;
+            x += controlsVisible;
 
-        let zoomScale = (totalWidth - (controlsNatural - controlsReserved)) / totalWidth;
+        let zoomScale = (totalWidth - (controlsNatural - controlsVisible)) / totalWidth;
         let newView = new WorkspacesView(width, height, x, y, zoomScale, this._workspaces);
 
         if (this.workspacesView)
@@ -765,7 +764,8 @@ WorkspacesDisplay.prototype = {
         let [controlsMin, controlsNatural] = this._controls.get_preferred_width(box.y2 - box.y1);
 
         // Amount of space on the screen we reserve for the visible control
-        let controlsReserved = controlsNatural * (1 - (1 - this._zoomFraction) * CONTROLS_POP_IN_FRACTION);
+        let controlsVisible = this._controls.get_theme_node().get_length('visible-width');
+        let controlsReserved = controlsVisible * (1 - this._zoomFraction) + controlsNatural * this._zoomFraction;
 
         let rtl = (St.Widget.get_default_direction () == St.TextDirection.RTL);
         if (rtl) {